package com.diver.flinkdemo.entity.Trd.yzhy;

/**
 * Created with IntelliJ IDEA.
 *
 * @Description:
 * @Author: zhangB
 * @Date: 2021/11/10 9:58
 */
public class YzhyResult {

    public static<W> YzhyRestResultVo getSuccessVo(W data){
        YzhyRestResultVo<W> vo = new YzhyRestResultVo();
        vo.setData(data);
        return vo;
    }

    public static<W> YzhyRestResultVo getSuccessVo(W data, int count){
        YzhyRestResultVo<W> vo = new YzhyRestResultVo();
        vo.setData(data);
        vo.setCount(count);
        return vo;
    }

    public static<W> YzhyRestResultVo getSuccessVo(String msg, int count,W data){
        YzhyRestResultVo<W> vo = new YzhyRestResultVo();
        vo.setMessage(msg);
        vo.setData(data);
        vo.setCount(count);
        return vo;
    }

    public static<W> YzhyRestResultVo getSuccessVo(String msg,W data){
        YzhyRestResultVo<W> vo = new YzhyRestResultVo();
        vo.setData(data);
        vo.setMessage(msg);
        return vo;
    }
    public static YzhyRestResultVo getSuccessVo(){
        return getSuccessVo(StatusCode.SUCCESS);
    }

    public static YzhyRestResultVo getSuccessVo(StatusCode statusCode){
        YzhyRestResultVo vo = new YzhyRestResultVo();
        vo.setCode(statusCode.getCode());
        vo.setMessage(statusCode.getMessage());
        return vo;
    }

    public  static YzhyRestResultVo getErrorVo(StatusCode statusCode, String msg){
        YzhyRestResultVo vo = new YzhyRestResultVo();
        vo.setCode(statusCode.getCode());
        vo.setMessage(msg);
        return vo;
    }

    public static YzhyRestResultVo getErrorVo(StatusCode statusCode){
        YzhyRestResultVo vo = new YzhyRestResultVo();
        vo.setCode(statusCode.getCode());
        vo.setMessage(statusCode.getMessage());
        return vo;
    }
    public static<W> YzhyRestResultVo getSocketVo(StatusCode statusCode,String msg, W data){
        YzhyRestResultVo<W> vo = new YzhyRestResultVo();
        vo.setData(data);
        vo.setCode(statusCode.getCode());
        vo.setData(data);
        vo.setMessage(msg);
        return vo;
    }
}
